package com.power.leopard.common.util;

public class LangUtil {

	public static int hash(String str, int mid, int range) {
		int hash, i;
		for (hash = str.length(), i = 0; i < str.length(); ++i) {
			hash = (hash << 4) ^ (hash >> 28) ^ str.charAt(i);
		}
		return mid + (hash % range);
	}
}
